package com.itheima.d6_polymorphism.demo1;

public class SiverCard extends Card{
    public SiverCard() {
    }

    public SiverCard(String carNumber, String name, int number, double money) {
        super(carNumber, name, number, money);
        //银卡办理时预存金额必须大于等于2000
        if (money >= 2000){
            setMoney(money);
            System.out.println("办理银卡成功！");
        }
    }

    //重写了父类的方法
    @Override
    public void pay(double money) {
        System.out.println("使用银卡支付了：" + money * 0.9);
    }
}
